<template>
  <!-- 人员操作 -->
  <h-modal class="event-modal" v-model="show" :title="'详情'" hidenOk>
    <a-descriptions title="" bordered :column="2">
      <a-descriptions-item label="属地">
        {{ form.possession }}
      </a-descriptions-item>
      <a-descriptions-item label="企业名称">
        {{ form.companyName }}
      </a-descriptions-item>
      <a-descriptions-item label="行业代码">
        {{ form.industryCode }}
      </a-descriptions-item>
      <a-descriptions-item label="统一社会信用代码">
        {{ form.unifiedSocialCreditCode }}
      </a-descriptions-item>
      <a-descriptions-item label="法定代表人">
        {{ form.legalRepresentative }}
      </a-descriptions-item>
      <a-descriptions-item label="注册资金">
        {{ form.registeredCapital }}
      </a-descriptions-item>
      <a-descriptions-item label="经营范围">
        {{ form.businessScope }}
      </a-descriptions-item>
      <a-descriptions-item label="经营地址">
        {{ form.address }}
      </a-descriptions-item>
      <a-descriptions-item label="备注" :span="2">
        {{ form.remark }}
      </a-descriptions-item>
    </a-descriptions>
  </h-modal>
</template>

<script>
import moment from 'moment';
// eslint-disable-next-line
import { queryInterLv1Detail } from '@/api/db';

export default {
  props: {
    id: {
      type: [Number, String],
      default: ''
    },
    showModal: {
      type: Boolean,
      default: false
    }
  },
  model: {
    prop: 'showModal',
    event: 'update:showModal'
  },
  watch: {
    showModal: {
      handler(val) {
        this.show = val;
        if (val) {
          this.detail();
          // detailAccount().then(res => {
          //   this.form = res.data || {};
          //   this.$set(this.form, 'isLayered', !!this.form.isLayered);
          // });
        }
      },
      immediate: true
    },
    show(val) {
      this.$emit('update:showModal', val);
    }
  },
  data() {
    return {
      moment,
      show: false,
      form: {},
      type: 'add',
      rules: {
        possession: [{ required: true, message: '请选择' }],
        companyName: [{ required: true, message: '请输入' }],
        platform: [{ required: true, message: '请输入' }],
        link: [{ required: true, message: '请输入' }]
      },
      addressArr: []
    };
  },
  methods: {
    detail() {
      queryInterLv1Detail({
        id: this.id
      }).then(res => {
        this.form = res.data;
      });
    }
  }
};
</script>

<style>

</style>
